<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui" template="/paginas/template.xhtml">

	<ui:define name="corpoForm">

		<h:form id="formEditarPessoa" prependId="false">

			<p:panelGrid columns="2" styleClass="botoes" id="botoes">
				<p:commandButton value="#{rsc.label_importarXML}" styleClass="botao"
					actionListener="#{gerarRelatoriosPessoasBean.importarXML}"
					update=":growl"
					onclick="setTimeout('document.getElementById(\'' + this.id + '\').disabled=true;', 50);"
					title="#{rsc.title_importarXML}" />

				<p:commandButton value="#{rsc.label_importarXML}" styleClass="botao"
					actionListener="#{gerarRelatoriosPessoasBean.importarXLS}"
					update=":growl"
					onclick="setTimeout('document.getElementById(\'' + this.id + '\').disabled=true;', 50);"
					title="#{rsc.title_importarXLS}" />

			</p:panelGrid>

			<f:event type="javax.faces.event.PreRenderComponentEvent"
				listener="#{gerarRelatoriosPessoasBean.preRenderImportarPessoas}" />

			<p:panel id="pnlImportarPessoas"
				header="#{rsc.label_dadosComunsPessoasImportadas}" toggleable="true"
				toggleSpeed="500">
				<p:panelGrid columns="2">
					<p:outputLabel value="#{rsc.label_tipoPessoa}"
						for="chkTiposPessoas" />
					<p:selectManyCheckbox id="chkTiposPessoas"
						value="#{gerarRelatoriosPessoasBean.formulario.tiposPessoaSelecionado}">
						<f:selectItems
							value="#{gerarRelatoriosPessoasBean.formulario.tiposPessoa}"
							var="c" itemLabel="#{c.label}" itemValue="#{c}" />
					</p:selectManyCheckbox>
				</p:panelGrid>
				<p:panelGrid columns="2">
					<p:outputLabel value="#{rsc.label_filial}" for="cmbFilial" />
					<p:selectOneMenu style="width: 150px" label="#{rsc.label_filial}"
						value="#{gerarRelatoriosPessoasBean.formulario.idFilial}"
						id="cmbFilial">
						<f:selectItem itemLabel="#{rsc.label_selecionar}" itemValue="" />
						<f:selectItems
							value="#{gerarRelatoriosPessoasBean.formulario.filiais}" var="c"
							itemLabel="#{c.nome}" itemValue="#{c.id}" />
					</p:selectOneMenu>
				</p:panelGrid>
			</p:panel>
			<p:panel id="pnlEstruturaXLS" header="#{rsc.label_estruturaXLS}"
				toggleable="true" toggleSpeed="500">

				<p:panel header="Squad">
					<p:dataGrid id="camposDisponiveis"
						value="#{gerarRelatoriosPessoasBean.formulario.listaCamposXls}"
						var="campo">
						<p:column>
							<h:outputText value="#{campo.label}"/>
							<p:draggable revert="true" scope="#{campo}" />
						</p:column>
					</p:dataGrid>
				</p:panel>

				<p:droppable tolerance="fit" activeStyleClass="slotActive"
					scope="forward" onDrop="handleDrop" datasource="camposDisponiveis">
				</p:droppable>
			</p:panel>

		</h:form>
	</ui:define>
</ui:composition>

